<template>
	<view>
		<view style="background-color: white;margin-top: 10px;">
			<view v-if="zhituiList.length>0">
				<view class="order-box" v-for="(item,i) in zhituiList" :key="item.index">
					<view class="number">{{item.usersName}}</view> 
					<view class="time">{{item.usersCreatetime}}</view> 
				</view>
			</view>
		</view>
		<view class="tips-text">{{tips}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ppid:'',		//品牌ID
				zhituiList:[],	//直推list集合
				page:1,			//页数
				limit:10,		//条数
				tips:"上拉加载更多数据",
			}
		},
		onReachBottom() {
			if(this.tips=='上拉加载更多数据'){
				this.page++;
				this.getTuanduiList();
			}
		},
		onLoad(opt) {
			this.ppid = opt.ppid
			this.getTuanduiList()
		},
		methods: {
			//得直推团队集合
			getTuanduiList(){
				this.$http.get('/ppUserPingpai/gettuandui',{
					ppid:this.ppid,
					userId:uni.getStorageSync('usersId'),
					page:this.page,
					limit:this.limit
				}).then(res => {
					console.log(res.data)
					if(res.data.code==200){
						if(res.data.data.length>0){
							this.zhituiList=this.zhituiList.concat(res.data.data);
							if(res.data.data.length>0 && res.data.data.length<this.limit){
								this.tips="";
							}
						}else{
							this.tips="没有更多数据";
						}
					}else{
						this.tips="没有更多数据";
					}
				})
			}
		}
	}
</script>

<style>
	.time{
		font-size: 10px;
		color: #d1d5dd;
		padding-bottom: 10rpx;
		border-bottom: 1rpx #c0c3cb solid;
	}
	.order-box{
		padding: 30rpx 50rpx 40rpx 50rpx;
	}
	.number {
		font-size: 18px;
		margin-bottom: 5px;
	}
	.time {
		font-size: 14px;
	}
	.tips-text{
		text-align: center;
	}
</style>
